<template>
  <el-dialog
      :visible.sync="visible"
      width="52%"
      :before-close="handleClose">
      <div slot="title">
        选择建群号
      </div>
      <div class="create-group-dialog-main">
        <div class="dialog-head">
          <el-input class="search-input" size="small" placeholder="搜索姓名" suffix-icon="el-icon-search" style="width: 218px;" />
          <div class="count-num">共0个号</div>
        </div>
        <el-checkbox-group v-model="checkList">
          <el-checkbox label="0">
            <div class="userInfo">
              <img src="@/assets/images/profile.jpg"/>
              <div class="name">小城红</div>
              <div class="label">@志新</div>
            </div>
          </el-checkbox>
          <el-checkbox label="1">
            <div class="userInfo">
              <img src="@/assets/images/profile.jpg"/>
              <div class="name">小城红</div>
              <div class="label">@志新</div>
            </div>
          </el-checkbox>
        </el-checkbox-group>
<!--        没有数据的时候展示-->
<!--        <div class="dialog-account-list">-->
<!--          <div class="list-empty">-->
<!--            <img class="empty-cover" src="@/assets/images/empty1.png" />-->
<!--            <div class="empty-text">赞无数据</div>-->
<!--          </div>-->
<!--        </div>-->
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="onHandleClose">取消</el-button>
        <el-button type="primary" @click="onSubmit">确定</el-button>
      </span>
    </el-dialog>
</template>
<script>
export default {
  data() {
    return {
      checkList: [],//选择的东西
    }
  },
  props: ['visible'],
  methods: {
    onHandleClose() {
      this.$emit('onHandleClose');
    },
    onSubmit() {
      this.$emit('onHandleClose');
    }
  }
}
</script>
<style lang="scss" scoped>
.create-group-dialog-main {
  font-size: 14px;
  word-wrap: break-word;
  .dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .count-num {
      color: rgba(0, 0, 0, .65);
    }
  }
  .dialog-account-list {
    display: flex;
    align-items: center;
    justify-content: center;
    .list-empty {
      flex: 1 1;
      margin: 20px auto;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      .empty-cover {
        height: 105px;
        width: 100px;
        object-fit: contain;
      }
      .empty-text {
        margin-top: 12px;
        font-size: 14px;
        color: rgba(0,0,0,.65);
      }
    }
  }
}
.userInfo {
  border-radius: 4px;
  margin: 8px 0;
  cursor: pointer;
  position: relative;
  padding-left: 50px;
  font-size: 14px;
  list-style: none;
  text-align: left;

  img {
    width: 40px;
    height: 40px;
    left: 0px;
    top: 0px;
    position: absolute;
  }

  .label {
    margin-top: 2px;
    font-size: 12px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: #f90;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
.el-checkbox-group {
  margin-top: 20px;
  .el-checkbox {
    position: relative;
    margin-right: 12px;
    margin-bottom: 12px;
    width: 201px;
    background: #fff;
    border-radius: 2px;
    border: 1px solid #e9e9e9;
    padding: 5px 12px;
    align-items: center;
    cursor: pointer;
    margin-top: 5px;
    margin-right: 15px;
    display: inline-flex;
   ::v-deep  .el-checkbox__input {
      display: none;
    }
    &.is-checked {
      border-color:#3b74ff;
      .name {
        color:#000 ;
      }
    }
  }
}
</style>
